package entity;

import java.util.Date;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;
import org.hibernate.validator.NotNull;

@Entity
public class StrategicPlan {

	@Id
	@GeneratedValue
	private Integer id;
	
	@NotNull
	private Date dataCriacao;
	
	@NotNull
	private Date dataFim;
	
	@ManyToOne(fetch = FetchType.LAZY)
	private Usuario usuario;
	
	private String nome;
	
	private String descricao;
	
	@ManyToOne(fetch = FetchType.LAZY)	
	private OrganizationElement organizacao;
	
	@OneToOne(mappedBy="strategicPlan", fetch = FetchType.LAZY)
	@Cascade(CascadeType.ALL)
	private SWOT swot;
	
	@OneToMany(mappedBy="strategicPlan", fetch = FetchType.LAZY)
	@Cascade({CascadeType.ALL, CascadeType.DELETE_ORPHAN})
	private List<GettingStartedSurvey> listGettingStartedSurvey;
	
	@OneToMany(mappedBy="strategicPlan", fetch = FetchType.LAZY)
	@Cascade({CascadeType.ALL, CascadeType.DELETE_ORPHAN})
	private List<BSC_Perspective> listPerspectives;
	
	@OneToOne(mappedBy="strategicPlan", fetch = FetchType.LAZY)
	@Cascade({CascadeType.ALL, CascadeType.DELETE_ORPHAN})
	private BSC bsc;
	
	public Integer getId() {
		return id;
	}
	
	public void setId(Integer id) {
		this.id = id;
	}
	
	public Date getDataCriacao() {
		return dataCriacao;
	}
	
	public void setDataCriacao(Date dataCriacao) {
		this.dataCriacao = dataCriacao;
	}
	
	public Date getDataFim() {
		return dataFim;
	}
	
	public void setDataFim(Date dataFim) {
		this.dataFim = dataFim;
	}
	
	public Usuario getUsuario() {
		return usuario;
	}
	
	public void setUsuario(Usuario usuario) {
		this.usuario = usuario;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public String getNome() {
		return nome;
	}

	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

	public String getDescricao() {
		return descricao;
	}

	public void setOrganizacao(OrganizationElement organizacao) {
		this.organizacao = organizacao;
	}

	public OrganizationElement getOrganizacao() {
		return organizacao;
	}

	public void setSwot(SWOT swot) {
		this.swot = swot;
	}

	public SWOT getSwot() {
		return swot;
	}

	public void setListGettingStartedSurvey(List<GettingStartedSurvey> listGettingStartedSurvey) {
		this.listGettingStartedSurvey = listGettingStartedSurvey;
	}

	public List<GettingStartedSurvey> getListGettingStartedSurvey() {
		return listGettingStartedSurvey;
	}

	public void setListPerspectives(List<BSC_Perspective> listPerspectives) {
		this.listPerspectives = listPerspectives;
	}

	public List<BSC_Perspective> getListPerspectives() {
		return listPerspectives;
	}

	public void setBsc(BSC bsc) {
		this.bsc = bsc;
	}

	public BSC getBsc() {
		return bsc;
	}
}
